//
//  TestSRVUIBlackfinController.m
//  iPhoneSRV
//
//  Created by Nick Kitchener on 28/04/2010.
//  Copyright 2010 __MyCompanyName__. All rights reserved.
//

#import "TestSRVUIBlackfinController.h"

#import "SRVBlackfinController.h"

@implementation TestSRVUIBlackfinController
#if USE_APPLICATION_UNIT_TEST     // all code under test is in the iPhone Application
- (void) testAppDelegate {
    id yourApplicationDelegate = [[UIApplication sharedApplication] delegate];
    STAssertNotNil(yourApplicationDelegate, @"UIApplication failed to find the AppDelegate");
}
#else                           // all code under test must be linked into the Unit Test bundle
- (void) testMath {
    STAssertTrue((1+1)==2, @"Compiler isn't feeling well today :-(" );
}
#endif

// pure IP connection and object handling tests
-(void)testSRVBlackfinController_Connection {
	
	SRVBlackfinController *blackfin = [[SRVBlackfinController alloc]init];
	
	STAssertTrue(blackfin!=nil);
	
	// Connecting to a real blackfin

	SRVConnectOperation *connect=[SRVConnectOperation connectWith:blackfin];
	[connect setCallback:self];
	[blackfin queueOperation:connect];
	
	
	// Connecting to a unknown ip address
	SRVConnectOperation *connect=[SRVConnectOperation connectWith:blackfin];
	[connect setCallback:self];
	[blackfin queueOperation:connect];
	
	// Connecting to an unknown port on a known IP address
	SRVConnectOperation *connect=[SRVConnectOperation connectWith:blackfin];
	[connect setCallback:self];
	[blackfin queueOperation:connect];
	
	
	// Two controllers, same IP address, same port
	SRVBlackfinController *blackfin = [[SRVBlackfinController alloc]init];
	SRVConnectOperation *connect=[SRVConnectOperation connectWith:blackfin];
	[connect setCallback:self];
	[blackfin queueOperation:connect];
	
	
	// Two controllers, same IP address, different ports
	SRVBlackfinController *blackfin = [[SRVBlackfinController alloc]init];
	SRVConnectOperation *connect=[SRVConnectOperation connectWith:blackfin];
	[connect setCallback:self];
	[blackfin queueOperation:connect];
	
	
	// Release test - memory low

	
	
}


// operation tests
-(void)testSRVBlackfinController_GetVersionOperation {
	
	SRVBlackfinController *blackfin = [[SRVBlackfinController alloc]init];
	
	STAssertTrue(blackfin!=nil);
	
	//
}

@end
